package map;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapDemo03 {
    public static void main(String[] args) {

        //1. 创建集合对象
        Map<String, String> map = new HashMap<>();

        //2. 添加对象
        map.put("乔纳森", "乔瑟夫");
        map.put("乔瑟夫", "承太郎");
        map.put("乔色夫", "承小郎");

        //3. 获取所有键值对对象的结婚证书
        Set<Map.Entry<String, String>> entrySet = map.entrySet();
        for (Map.Entry<String, String> str : entrySet) {

            String key = str.getKey();
            String value = str.getValue();
            System.out.println(key + ",\t" + value);
        }
    }
}
